import request from '@/utils/request'

export function getMainCategory() {
  return request({
    url: '/api/categories',
    method: 'get'
  })
}

export function createMainCategory(data) {
  return request({
    url: '/api/categories',
    method: 'post',
    data
  })
}

export function updateMainCategory(data) {
  return request({
    url: '/api/categories/' + data.id,
    method: 'put',
    data: {
      name: data.name
    }
  })
}

